<template>
  <div class="box">
    <div class="title">
      <div><img src="~assets/logo.svg" alt=""></div> 
      <div>&nbsp;达英尔书写质量评判后台管理</div> 
    </div>

    <div class="logout">
      <h2>{{ username }}</h2>
      <el-button type="warning" @click="clearSession">注销</el-button>
    </div>
  </div>
</template>

<script>import router from "../router"

export default {
  data() {
    return {
      username: window.sessionStorage.username
    }
  },
  methods: {
    clearSession() {
      window.sessionStorage.clear()
      router.push('/admin-login')
    }
  }
}
</script>

<style lang="less" scoped>
  .box {
    width: 100%;
    padding: 0 20px;
    background-color: #1f2d3d;
    text-align: center;
    display: flex;
    justify-content: space-between;

    .title {
      font-size: 30px;
      color: #fff;
      display: flex;
      justify-content: space-around;
      align-items: center;
    }
    .logout {
      display: flex;
      justify-content: space-around;
      align-items: center;
      h2 {
        color: #fff;
        padding-right: 20px;
      }
    }
  }
</style>